propertyselection: Add getters
authorMatthias Clasen <mclasen@redhat.com>
Thu, 11 Jun 2020 11:15:27 +0000 (07:15 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Thu, 11 Jun 2020 11:35:20 +0000 (07:35 -0400)
These were missing.

docs/reference/gtk/gtk4-sections.txt
gtk/gtkpropertyselection.c
gtk/gtkpropertyselection.h

index 38089324790abf7e2fd1601e779b622397c9bd11..bc70b8bce1885509111541083dcff61dffe45543 100644 (file)
@@ -409,6 +409,8 @@ gtk_multi_selection_get_type
 <TITLE>GtkPropertySelection</TITLE>
 GtkPropertySelection
 gtk_property_selection_new
+gtk_property_selection_get_model
+gtk_property_selection_get_property
 <SUBSECTION Private>
 gtk_property_selection_get_type
 </SECTION>
index 3f4c192ba185a77ac4fbb6f09ecc4fcaedaf051c..25fb94846d929906f7508379a422487762d9ca5a 100644 (file)
@@ -355,10 +355,10 @@ gtk_property_selection_clear_model (GtkPropertySelection *self)
 }
 
 static void
-gtk_property_selection_set_property (GObject      *object,
-                                     guint         prop_id,
-                                     const GValue *value,
-                                     GParamSpec   *pspec)
+gtk_property_selection_real_set_property (GObject      *object,
+                                          guint         prop_id,
+                                          const GValue *value,
+                                          GParamSpec   *pspec)
 
 {
   GtkPropertySelection *self = GTK_PROPERTY_SELECTION (object);
@@ -399,10 +399,10 @@ gtk_property_selection_set_property (GObject      *object,
 }
 
 static void
-gtk_property_selection_get_property (GObject    *object,
-                                     guint       prop_id,
-                                     GValue     *value,
-                                     GParamSpec *pspec)
+gtk_property_selection_real_get_property (GObject    *object,
+                                          guint       prop_id,
+                                          GValue     *value,
+                                          GParamSpec *pspec)
 {
   GtkPropertySelection *self = GTK_PROPERTY_SELECTION (object);
 
@@ -439,8 +439,8 @@ gtk_property_selection_class_init (GtkPropertySelectionClass *klass)
 {
   GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
 
-  gobject_class->get_property = gtk_property_selection_get_property;
-  gobject_class->set_property = gtk_property_selection_set_property;
+  gobject_class->get_property = gtk_property_selection_real_get_property;
+  gobject_class->set_property = gtk_property_selection_real_set_property;
   gobject_class->dispose = gtk_property_selection_dispose;
 
   /**
@@ -497,3 +497,36 @@ gtk_property_selection_new (GListModel *model,
                        "property", property,
                        NULL);
 }
+
+/**
+ * gtk_property_selection_get_model:
+ * @self: a #GtkPropertySelection
+ *
+ * Gets the underlying model.
+ *
+ * Returns: (transfer none): the underlying model
+ */
+GListModel *
+gtk_property_selection_get_model (GtkPropertySelection *self)
+{
+  g_return_val_if_fail (GTK_IS_PROPERTY_SELECTION (self), NULL);
+
+  return self->model;
+}
+
+/**
+ * gtk_property_selection_get_property:
+ * @self: a #GtkPropertySelection
+ *
+ * Gets the name of the item property that @self stores
+ * the selection in.
+ *
+ * Returns: the name of the property
+ */
+const char *
+gtk_property_selection_get_property (GtkPropertySelection *self)
+{
+  g_return_val_if_fail (GTK_IS_PROPERTY_SELECTION (self), NULL);
+
+  return self->property;
+}
index 60378ae655a88fe63c0b758e1eec6f51ea2ddc5a..8a2440449f96c8ca5d27d54e12f23d4b7ca44ba5 100644 (file)
@@ -34,6 +34,11 @@ GDK_AVAILABLE_IN_ALL
 GListModel *    gtk_property_selection_new      (GListModel     *model,
                                                  const char     *property);
 
+GDK_AVAILABLE_IN_ALL
+GListModel *    gtk_property_selection_get_model    (GtkPropertySelection *self);
+
+GDK_AVAILABLE_IN_ALL
+const char *    gtk_property_selection_get_property (GtkPropertySelection *self);
 
 G_END_DECLS